Skip to content

Enhance CSP documentation #9959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

Robinfr
Copy link
Contributor

@Robinfr Robinfr commented Aug 11, 2025

  • Add Headers custom runtime setting recommendations for nonce-based CSP
  • Add CSP support section for Java request handlers
  • Include CspHelper API documentation and code examples
  • Provide best practices and common issue solutions for CSP implementation
  • Update cloud deployment methods with clear recommendations

- Add Headers custom runtime setting recommendations for nonce-based CSP
- Add CSP support section for Java request handlers
- Include CspHelper API documentation and code examples
- Provide best practices and common issue solutions for CSP
implementation
- Update cloud deployment methods with clear recommendations
@Robinfr
Copy link
Contributor Author

Robinfr commented Aug 11, 2025

Needs internal review

CSP support is only relevant for request handlers that serve static content such as HTML pages, not for API endpoints that return JSON or other data formats.
{{% /alert %}}

This section describes how to properly handle CSP headers in your Java request handlers when serving HTML content.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am missing a small explanation about what nonces are and how they work (and maybe a link to mdn would be nice)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure where I would put a link to MDN in this documentation? I don't want to elaborate on nonces too much to be honest. If you need to know what they are when reading this, you likely shouldn't be reading this documentation since that is an advanced topic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that an explanation is too much, the point I was trying to make is that nonces are not introduced at all. Maybe the sentence at line 179 can be extended with:

If you are developing Marketplace modules or custom Java actions that include request handlers, you may need to implement CSP support to ensure compatibility with strict CSP policies. Nonces can be implemented to securely allow necessary inline scripts and styles while maintaining robust content security.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a short introduction to nonces referencing CSP level 2

@OlufunkeMoronfolu
Copy link
Collaborator

@Robinfr Please let me know when the technical verification is done and when it's ready for tech writer's review.

@brambrink
Copy link
Contributor

Hey @OlufunkeMoronfolu, it is ready for tech writer's review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants